<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ToDo_vue</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <link rel="stylesheet" href="https://at.alicdn.com/t/c/font_4624650_qep591gdyh.css">
    <link rel="stylesheet" href="./css/ToDo.css">
</head>
<body>
<div id="myToDo" class="myToDo">
    <h1>To Do</h1>
    <div>
        <div class="ToDoBox">
            <div id="getToDo" class="getToDo">
                <label>
                    <input @keydown.enter="add" type="text" id="newToDo" placeholder="点击添加代办">
                    <button @click="add" id="addToDo">添加</button>
                </label>
            </div>
            <div id="ToDo" class="ToDo" v-if="ToDoList.length">
                <ul id="ToDo_Ul" class="ToDo_Ul">
                    <li v-for="ToDoList in ToDoList" class="ToDoList">
                        <div>
                            <input @click="ifAccomplish(ToDoList.id,{completed:ToDoList.completed})"
                                   :checked="ToDoList.completed" type="checkbox" name="" id="">
                            <p v-if="!ToDoList.accomplish">{{ ToDoList.title }}</p>
                            <del v-else>{{ ToDoList.title }}</del>
                        </div>
                        <button @click="del(ToDoList.id)" class="iconfont icon-shanchu"></button>
                    </li>
                </ul>
                <ul id="ability" class="ability">
                    <li><a href="" @click.prevent="selectAll">
                        <span v-if="!ifAllSelect">全选</span>
                        <span v-else>不全选</span>
                    </a></li>
                    <li>
                        <select @change="show" id="showToDo">
                            <option>显示所有</option>
                            <option>显示未完成</option>
                            <option>显示已完成</option>
                        </select>
                    </li>
                    <li><a @click.prevent="delAll" href="">删除所有</a></li>
                </ul>
            </div>
        </div>
    </div>

</div>
<script type="module" src="./js/ToDo.js"></script>

</body>
</html>